﻿#pragma once

#include "json_trans.h"
#include "common_data.h"

// 物料位置描述
// {编号，XY方向基准点类型(左，右，中心偏左，中心偏右；下、上、中心偏下、中心偏上)，
//  XY方向计算偏移(几个半宽+几个半长)，旋转角度}
structJ(SkuShapPos,
	mapping(int, id);
mapping(int, typex);
mapping(int, typey);
mapping(int, lenX);
mapping(int, widX);
mapping(int, lenY);
mapping(int, widY);
mapping(int, za);
prop(&id, &typex, &typey, &lenX, &widX, &lenY, &widY, &za);
);

// 垛形形状描述 
// {编号、名称，单层数量，长宽比最小值和最大值，x方向垛形长度(物料宽+物料长)，Y方向垛形长度，物料位置信息}
structJ(ShapCfg,
	mapping(int, id);
mapping(QString, name);
mapping(int, num);
mapping(double, aspectMin);
mapping(double, aspectMax);
mapping(int, lenX);
mapping(int, widX);
mapping(int, lenY);
mapping(int, widY);
mapping(QList<SkuShapPos>, sku);
prop(&id, &name, &num, &aspectMin, &aspectMax, &lenX, &lenY, &widX, &widY, &sku);
);

structJ(SkuPos,
	mapping(int, id);
mapping(int, group);
mapping(int, x);
mapping(int, y);
mapping(int, z);
mapping(int, za);
prop(&id, &group, &x, &y, &z, &za);
)

// 垛形信息描述
// {编号， 名称，货物间隙，最大数量，奇偶层转换方式，垛形形状，物料尺寸，}
structJ(StackCfg,
	mapping(int, id);
mapping(QString, name);
mapping(int, gap);
mapping(int, max);
mapping(int, evenType);
mapping(int, shap);
mapping(SizeJ, sku);
mapping(QList<SkuPos>, position);
prop(&id, &name, &gap, &shap, &max, &evenType, &sku, &position);
)


structJ(StackConfiguration,
	mapping(QList<ShapCfg>, shapList);
mapping(QList<StackCfg>, stackList);
prop(&shapList, &stackList);
);
